Attribute VB_Name = "AddReferences"
Option Explicit

Public Sub AddReferences()
'    Set ref = Application.ActiveWorkbook.VBProject.References.AddFromGuid(GUID:="{000204EF-0000-0000-C000-000000000046}", Major:=4, Minor:=2) ' Visual Basic For Applications
    Debug.Print Application.ActiveWorkbook.VBProject.References.Count
    
    On Error Resume Next
    Set ref = Application.ActiveWorkbook.VBProject.References.AddFromGuid(GUID:="{00020813-0000-0000-C000-000000000046}", Major:=1, Minor:=9) ' Microsoft Excel 16.0 Object Library
    Set ref = Application.ActiveWorkbook.VBProject.References.AddFromGuid(GUID:="{00020430-0000-0000-C000-000000000046}", Major:=2, Minor:=0) ' OLE Automation
    Set ref = Application.ActiveWorkbook.VBProject.References.AddFromGuid(GUID:="{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}", Major:=2, Minor:=8) ' Microsoft Office 16.0 Object Library
    
    
    
    Set ref = Application.ActiveWorkbook.VBProject.References.AddFromGuid(GUID:="{3F4DACA7-160D-11D2-A8E9-00104B365C9F}", Major:=5, Minor:=5) ' Microsoft VBScript Regular Expressions 5.5

    Set ref = Application.ActiveWorkbook.VBProject.References.AddFromGuid(GUID:="{0D452EE1-E08F-101A-852E-02608C4D0BB4}", Major:=2, Minor:=0) ' Microsoft Forms 2.0 Object Library

    Set ref = Application.ActiveWorkbook.VBProject.References.AddFromGuid(GUID:="{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}", Major:=2, Minor:=2) ' Microsoft Windows Common Controls 6.0 (SP6)
    Set ref = Application.ActiveWorkbook.VBProject.References.AddFromGuid(GUID:="{420B2830-E718-11CF-893D-00A0C9054228}", Major:=1, Minor:=0) ' Microsoft Scripting Runtime

    Set ref = Application.ActiveWorkbook.VBProject.References.AddFromGuid(GUID:="{0002E157-0000-0000-C000-000000000046}", Major:=5, Minor:=3) ' Microsoft Visual Basic for Applications Extensibility 5.3

    Set ref = Application.ActiveWorkbook.VBProject.References.AddFromGuid(GUID:="{000204EF-0000-0000-C000-000000000046}", Major:=4, Minor:=2) ' Visual Basic For Applications
End Sub
